﻿<!--#include file="include/Money_ratio.asp"-->
<!--#include file="include/conn_f.asp"-->
<!--#include file="top.asp"-->
<!--#include file="left.asp"-->
<%
game_id=left(saferequest("game_id",1),4)
select_currency = Left(GetSafeRequest("select_currency", 0, "USD"), 3)
%>

<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $("select.currency").bind("change", function () {
            <%If UrlRewrite() = True Then%>
                window.location.href = "cardbygame_" + $(this).val() + "_<%=game_id%>.html";
            <%Else %>
                window.location.href = "cardbygame.asp?game_id=<%=game_id%>&select_currency=" + $(this).val();
            <%End If %>            
        });
    });
</script>

<div class="content">
<!--#include file="include/category.asp"-->
<br />
<%
'----------
If game_id<>"" And IsNumeric(game_id) Then 
    sql="select game_name from game where game_id="&CInt(game_id)
        Set rs=conn.execute(sql)
            If Not rs.eof Then 
                game_name=rs("game_name")
            End If 
    rs.close
    Set rs=Nothing 
End If 
%>
<div style="text-align: left; padding-left: 15px;">
    可以用于充值--<b><%=game_name%></b>--的商品有:</div>
<%
sql="select b.card_name,b.card_info_id,b.photo from card_game as a left join card_infor as b on a.card_infor_id=b.card_info_id where a.isshow=1 and b.onsale=1 and a.game_id="&CInt(game_id)
%>
<table align="center" width="95%" border="0" class="unnamed1" cellspacing="2" cellpadding="0">
    <%
Dim goods_type

Set rs=server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
If rs.eof And rs.bof Then 
    Response.Write "<tr><td align=""center"">暂无相关商品</td></tr>"
Else
    Do While Not rs.eof 

        Response.Write "<tr><td align=""center"" valign=""middle"" width=""120"">"
        Response.Write "<a href="""&MapUrl3("cardsell", "select_currency", select_currency, "id", rs("card_info_id"))&""" title="""&rs("card_name")&"""><img src=""photo/"&rs("photo")&""" border=""0"" width=""100"" alt="""&rs("card_name")&"""></a></td>"
        Response.Write "<td valign=""top"">"

            Response.Write "<table border=""0"" cellpadding=""2"" cellspacing=""1"" width=""100%"">"
            Response.Write "<tr><td>"
            Response.Write "<div class=""left""><img src=""image/ico_1.jpg"" />&nbsp;<a href="""&MapUrl3("cardsell", "select_currency", select_currency, "id", rs("card_info_id"))&""" title="""&rs("card_name")&""">"&rs("card_name")&"</a></div>"

            Response.Write "<div class=""right"">"

            Response.Write "<select class='currency'>"
            If select_currency="USD" Then
                Response.Write "<option value='USD' selected>美元</option>"
            Else
                Response.Write "<option value='USD'>美元</option>"
            End If
            If select_currency="CAD" Then
                Response.Write "<option value='CAD' selected>加元</option>"
            Else
                Response.Write "<option value='CAD'>加元</option>"
            End If
            If select_currency="GBP" Then
                Response.Write "<option value='GBP' selected>英磅</option>"
            Else
                Response.Write "<option value='GBP'>英磅</option>"
            End If
            If select_currency="EUR" Then
                Response.Write "<option value='EUR' selected>欧元</option>"
            Else
                Response.Write "<option value='EUR'>欧元</option>"
            End If
            If select_currency="AUD" Then
                Response.Write "<option value='AUD' selected>澳元</option>"
            Else
                Response.Write "<option value='AUD'>澳元</option>"
            End If
            If select_currency="JPY" Then
                Response.Write "<option value='JPY' selected>日元</option>"
            Else
                Response.Write "<option value='JPY'>日元</option>"
            End If
            If select_currency="SGD" Then
                Response.Write "<option value='SGD' selected>新元</option>"
            Else
                Response.Write "<option value='SGD'>新元</option>"
            End If
            If select_currency="CNY" Then
                Response.Write "<option value='CNY' selected>人民币</option>"
            Else
                Response.Write "<option value='CNY'>人民币</option>"
            End If
            Response.Write "</select>"

            Response.Write "</div>"
            Response.Write "</td></tr>"

            sql="select card_id,card_memo,goods_type,price,vip_price,miane from card where card_infor_id="&rs("card_info_id")
            sql=sql&" and onsale=1 order by price asc"
            Set tmp=server.CreateObject("ADODB.RecordSet")
            tmp.open sql,conn,1,1
            If tmp.eof And tmp.bof Then 
                
            Else
                Do While Not tmp.eof 
                    goods_type=""

                    '显示卡种类别
                    If Trim(tmp("goods_type"))=0 Then 
                        goods_type="卡密"
                    ElseIf Trim(tmp("goods_type"))=1 Then 
                        goods_type="直充"
                    ElseIf Trim(tmp("goods_type"))=3 Then 
                        goods_type="邮寄"
                    ElseIf Trim(tmp("goods_type"))=4 Then 
                        goods_type="扫描"
                    Else
                        goods_type="未知类型"
                    End If 

                    price=tmp("price")
                    vip_price=tmp("vip_price")
                    select case select_currency
                        case "USD"
                            price_cur=FormatNumber( price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
                        case "CAD"
                            price_cur=FormatNumber( price*BASE_RT/CAD_RATIO,2 )&"&nbsp;加拿大元"
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/CAD_RATIO,2 )&"&nbsp;加拿大元"
                        case "GBP"
                            price_cur=FormatNumber( price*BASE_RT/GBP_RATIO,2 )&"&nbsp;英磅" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/GBP_RATIO,2 )&"&nbsp;英磅" 
                        case "EUR"
                            price_cur=FormatNumber( price*BASE_RT/EUR_RATIO,2 )&"&nbsp;欧元" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/EUR_RATIO,2 )&"&nbsp;欧元" 
                        case "AUD"
                            price_cur=FormatNumber( price*BASE_RT/AUD_RATIO,2 )&"&nbsp;澳大利亚元" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/AUD_RATIO,2 )&"&nbsp;澳大利亚元"
                        case "JPY"
                            price_cur=FormatNumber( price*BASE_RT/JPY_RATIO,2 )&"&nbsp;日元" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/JPY_RATIO,2 )&"&nbsp;日元"
                        case "SGD"
                            price_cur=FormatNumber( price*BASE_RT/SGD_RATIO,2 )&"&nbsp;新加坡元" 
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/SGD_RATIO,2 )&"&nbsp;新加坡元"
                        case "CNY"
                            price_cur=FormatNumber( price,2 )&"&nbsp;元" 
                            price_vip_cur=FormatNumber( vip_price,2 )&"&nbsp;元"
                        case Else
                            select_currency="USD"
                            price_cur=FormatNumber( price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
                            price_vip_cur=FormatNumber( vip_price*BASE_RT/USD_RATIO,2 )&"&nbsp;美元"
                    end  Select

                    Response.Write "<tr><td bgcolor=""#EFF5FA"">"

                    Response.Write "<div class=""div1"">"&tmp("card_memo")&"</a>(<font style=""color:#008000;"">"&goods_type&"</font>)"	
                    Response.Write "-"&tmp("miane")&"</div>"

                    Response.Write "<div class=""div1"">会员价：<font style=""color:#ff0000;"">"&price_cur&"</font>"

                    Response.Write "&nbsp;&nbsp;VIP价：<font style=""color:#ff0000;"">"&price_vip_cur&"</font></div>"

                    Response.Write "<div class=""div1""><a href="""&MapUrl3("order", "select_currency", select_currency, "card_id", tmp("card_id"))&""" title='在线购买&nbsp;' target=""""><font color='red'>购买&gt;&gt;</font></a></div>"

                    Response.Write "</td></tr>"
                    tmp.movenext
                    If tmp.eof Then Exit Do 
                Loop 
            End If 
            tmp.close
            Set tmp=Nothing 

            Response.Write "</table>"

        Response.Write "</td></tr>"
        Response.Write "<tr><td colspan=""2""><div style=""background-image:url('image/ico_2.jpg');background-repeat:repeat-x;"">&nbsp;</div></td></tr>"
        rs.movenext
        If rs.eof Then Exit Do 
    Loop 
End If 
rs.close
Set rs=Nothing 
    %>
</table>
</div>
<!--#include file="bottom.asp"-->
